<style lang="scss" scoped="">
  @import "../../../utils/base.scss";

  .myLabel:before {
    content: '*';
    display: inline-block;
    margin-right: 4px;
    line-height: 1;
    font-family: SimSun;
    font-size: 14px;
    color: #ed4014;
  }

  .myInput {
    border: 1px solid #ed4014
  }

  .myForm {
    position: relative;
    line-height: 32px;
    font-size: 14px;
  }

  #numberfile {
    display: none;
  }
</style>
<template>
  <div style="overflow-x: hidden;">
    <div style="padding-bottom: 5px;">
  	   <Button v-if="!isShow && !ifedit && !isEdit && (removeAccountIdList.length>0 || account.length>0) " type="primary" size="small" @click="resetAccount">重置</Button>
    </div>
    <table border="1px" class="tale" v-if="account.length>0 || isEdit">
      <tr align="center" class="tale_title">
        <th style="width: 20%">
          <label class="myLabel">账号模板名称</label>
        </th>
        <th style="width: 30%">
          <label v-if="isEdit" class="myLabel">入驻位置</label>
          <label v-else class="myLabel">关联的工具/资源</label>
        </th>
        <th>
          <label>已关联账号数</label>
        </th>
        <td style="width:18%">
          <Button v-if="isEdit" type="primary" size="small" @click="addRow">新增</Button>
          <label v-else>操作</label>
        </td>
      </tr>
      <template v-if="account.length>0" v-for="(item, index) in account">
        <tr align="center" style="height:50px" :key="index">
          <td>
          	<span v-if="!item.ifedit">{{account[index].modelName}}</span>
            <Input v-else v-model="account[index].modelName" style="width: 90%"></Input>
          </td>
          <td v-if="isEdit">
            <span v-if="!item.ifedit">{{showSysName(account[index].sysModel)}}</span>
            <Select v-else v-model="account[index].sysIdList" :label-in-value="true" :transfer="true" filterable
              multiple style="width:90%" align="left">
              <Option v-for="item in sysList" :value="item.id" :key="item.id" :disabled="item.isDisabled"
                :label="item.sysName">
              </Option>
            </Select>
          </td>
          <td v-else>
            <span>{{account[index].serviceName}}</span>
          </td>
          <td>
            <span>{{showCount(item)}}</span>
          </td>
          <td v-if="isEdit">
          	<template v-if="item.ifedit">
          		<Button type="primary" size="small" @click="saveRow(index)">确定</Button>
          		<Button size="small" @click="editRow(index)">取消</Button>
          	</template>
          	<template v-else>
          		<Button type="primary" size="small" @click="expandRow(index)">{{(item.isExpand < 0)?'展开':'收起'}}</Button>
          		<Button  type="primary" size="small" @click="editRow(index)">编辑</Button>
				<Button  type="warning" size="small" @click="removeRow(index)">删除</Button>
          	</template>
          </td>
          <td v-else>
          	<Button :disabled="isPrint" type="primary" size="small" @click="expandRow(index)">{{(item.isExpand < 0)?'展开':'收起'}}</Button>
          	<Button v-if="!ifedit && !isShow" type="warning" size="small" @click="removeAccount(index)">删除</Button>
          </td>
          </Form>
        </tr>
        <tr v-show="item.isExpand >= 0">
          <td colspan="7">
            <Form ref="account[index]" :model="account[index].accountPeopleEntity" label-position="left" :label-width="120"
              style="position:relative;left:4%;padding:1%;">
              <Row>
                <Col span="24">
               <!--  <FormItem label="账号类型："> -->
                  <Col v-if="item.ifedit || account[index].isSever">
                  <Checkbox v-model="account[index].isSever" @on-change="changeSever(index)" :disabled="!item.ifedit">
                    <span>主机账号</span>
                  </Checkbox>
                  <table border="1px" class="tale" style="position:relative;left:2%;max-width:90%"
                    v-if="account[index].isSever">
                    <tr align="center" class="tale_title">
                      <th>
                        <label class="myLabel">账号属性</label>
                      </th>
                      <th>
                        <label class="myLabel">设备IP地址</label>
                      </th>
                      <th>
                        <label>设备名称</label>
                      </th>
                      <th>
                        <label>组读和执行权限目录</label>
                      </th>
                      <th>
                        <label>该用户组需写权限目录</label>
                      </th>
                      <td v-if="item.ifedit">
                        <Button type="primary" size="small" @click="addServer(index)">新增</Button>
                      </td>
                    </tr>
                    <template v-for="(ser, ser_index) in account[index].accountPeopleEntity.severs">
                      <tr align="center" style="height:50px">
                        <td style="width:8%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.severs[ser_index].accountAttr}}</span>
                          <Select v-else v-model="account[index].accountPeopleEntity.severs[ser_index].accountAttr" style="width:90%"
                            :transfer="true">
                            <Option v-for="item in attrList" :value="item.value" :key="item.value">{{ item.label }}
                            </Option>
                          </Select>
                        </td>
                        <td style="width:10%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.severs[ser_index].ip}}</span>
                          <Input v-else style="width: 90%;" v-model="account[index].accountPeopleEntity.severs[ser_index].ip"></Input>
                        </td>
                        <td style="width:10%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.severs[ser_index].sname}}</span>
                          <Input v-else style="width:90%;" v-model="account[index].accountPeopleEntity.severs[ser_index].sname"></Input>
                        </td>
                        <td style="width:10%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.severs[ser_index].rxPath}}</span>
                          <Input v-else style="width: 90%;" v-model="account[index].accountPeopleEntity.severs[ser_index].rxPath"></Input>
                        </td>
                        <td style="width:10%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.severs[ser_index].wpath}}</span>
                          <Input v-else style="width: 90%;" v-model="account[index].accountPeopleEntity.severs[ser_index].wpath"></Input>
                        </td>
                        <td style="width:5%" v-if="item.ifedit">
                          <Button type="warning" size="small" @click="removeServer(index,ser_index)">删除</Button>
                        </td>
                      </tr>
                    </template>
                  </table>
                  </Col>
                  <Col v-if="item.ifedit || account[index].isDb" style="padding-top: 10px">
                  <Checkbox v-model="account[index].isDb" @on-change="changeDb(index)" :disabled="!item.ifedit">
                    <span>数据库账号</span>
                  </Checkbox>
                  <table border="1px" class="tale" style="position:relative;left:2%;max-width:90%"
                    v-if="account[index].isDb">
                    <tr align="center" class="tale_title">
                      <th>
                        <label class="myLabel">数据库类型</label>
                      </th>
                      <th>
                        <label class="myLabel">账号属性</label>
                      </th>
                      <th>
                        <label class="myLabel">设备IP地址</label>
                      </th>
                      <th>
                        <label>资源池/设备名称</label>
                        <Tooltip content="数据库类型为GBase或Vertica时必填" max-width="200" placement="right" :transfer="true"
                          style="white-space: normal;width: 10px">
                          <Icon type="md-help-circle" />
                        </Tooltip>
                      </th>
                      <th>
                        <label>schema/集群名</label>
                        <Tooltip content="数据库类型为GBase或Vertica时必填:申请Vertica请填写schema;申请GBase请填写集群名" max-width="200"
                          placement="right" :transfer="true" style="white-space: normal;width: 10px">
                          <Icon type="md-help-circle" />
                        </Tooltip>
                      </th>
                      <th>
                        <label class="myLabel">权限</label>
                      </th>
                      <th>
                        <label>库名</label>
                      </th>
                      <th>
                        <label>表名</label>
                      </th>
                      <td v-if="item.ifedit">
                        <Button type="primary" size="small" @click="addDB(index)">新增</Button>
                      </td>
                    </tr>
                    <template v-for="(db, db_index) in account[index].accountPeopleEntity.dbs">
                      <tr align="center" style="height:50px">
                        <td style="width:10%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.dbs[db_index].dbType}}</span>
                          <Select v-else v-model="account[index].accountPeopleEntity.dbs[db_index].dbType" style="width:90%">
                            <Option v-for="item in dbTypeList" :value="item.value" :key="item.value">{{ item.label }}
                            </Option>
                          </Select>
                        </td>
                        <td style="width:10%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.dbs[db_index].accountAttr}}</span>
                          <Select v-else v-model="account[index].accountPeopleEntity.dbs[db_index].accountAttr" style="width:90%">
                            <Option v-for="item in attrList" :value="item.value" :key="item.value">{{ item.label }}
                            </Option>
                          </Select>
                        </td>
                        <td style="width:10%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.dbs[db_index].ip}}</span>
                          <Input v-else style="width: 90%;" v-model="account[index].accountPeopleEntity.dbs[db_index].ip"></Input>
                        </td>
                        <td style="width:10%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.dbs[db_index].sname}}</span>
                          <Input v-else style="width:90%;" v-model="account[index].accountPeopleEntity.dbs[db_index].sname"></Input>
                        </td>
                        <td style="width:10%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.dbs[db_index].schema}}</span>
                          <Input v-else style="width:90%;" v-model="account[index].accountPeopleEntity.dbs[db_index].schema"></Input>
                        </td>
                        <td style="width:10%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.dbs[db_index].auth}}</span>
                          <Input v-else style="width: 90%;" v-model="account[index].accountPeopleEntity.dbs[db_index].auth"></Input>
                        </td>
                        <td style="width:10%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.dbs[db_index].dbName}}</span>
                          <Input v-else style="width: 90%;" v-model="account[index].accountPeopleEntity.dbs[db_index].dbName"></Input>
                        </td>
                        <td style="width:10%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.dbs[db_index].tableName}}</span>
                          <Input v-else style="width: 90%;" v-model="account[index].accountPeopleEntity.dbs[db_index].tableName"></Input>
                        </td>
                        <td style="width:8%" v-if="item.ifedit">
                          <Button type="warning" size="small" @click="removeDB(index,db_index)">删除</Button>
                        </td>
                      </tr>
                    </template>
                  </table>
                  </Col>
                  <Col v-if="item.ifedit || account[index].isHadoop" style="padding-top: 10px">
                  <Checkbox v-model="account[index].isHadoop" @on-change="changeHadoop(index)" :disabled="!item.ifedit">
                    <span>Hadoop账号</span>
                  </Checkbox>
                  <table border="1px" class="tale" style="position:relative;left:2%;max-width:90%"
                    v-if="account[index].isHadoop">
                    <tr align="center" class="tale_title">
                      <th>
                        <label class="myLabel">keytab描述</label>
                      </th>
                      <th>
                        <label class="myLabel">Hadoop组件</label>
                      </th>
                      <th>
                        <label class="myLabel">具体权限描述</label>
                      </th>
                      <td v-if="item.ifedit">
                        <Button type="primary" size="small" @click="addHadoop(index)">新增</Button>
                      </td>
                    </tr>
                    <template v-for="(hadoop, ha_index) in account[index].accountPeopleEntity.hadoops">
                      <tr align="center" style="height:50px">
                        <td style="width:20%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.hadoops[ha_index].keytab}}</span>
                          <Input v-else style="width:90%;" v-model="account[index].accountPeopleEntity.hadoops[ha_index].keytab"></Input>
                        </td>
                        <td style="width:15%">
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.hadoops[ha_index].hadoopAccountType}}</span>
                          <Select v-else filterable v-model="account[index].accountPeopleEntity.hadoops[ha_index].hadoopAccountType"
                            style="width:90%">
                            <Option v-for="item in hadoopList" :value="item.value" :key="item.value">{{ item.label }}
                            </Option>
                          </Select>
                        </td>
                        <td>
                          <span v-if="!item.ifedit">{{account[index].accountPeopleEntity.hadoops[ha_index].auth}}</span>
                          <Input v-else style="width: 90%;" v-model="account[index].accountPeopleEntity.hadoops[ha_index].auth"></Input>
                        </td>
                        <td style="width:8%" v-if="item.ifedit">
                          <Button type="warning" size="small" @click="removeHadoop(index,ha_index)">删除</Button>
                        </td>
                      </tr>
                    </template>
                  </table>
                  </Col>
                  <Col v-if="item.ifedit || account[index].isHftp" style="padding-top: 10px">
                  <Checkbox v-model="account[index].isHftp" @on-change="changeUap(index)" :disabled="!item.ifedit">
                    <span>UAP账号</span>
                  </Checkbox>
                  <template v-if="account[index].isHftp">
                    <Row>
                      <Col style="left:2%">
                      <label class="myLabel">场景说明：</label>
                      </Col>
                      <Col style="left:2%">
                      <Checkbox v-model="account[index].accountPeopleEntity.hftps[0].isCluster" :disabled="!item.ifedit">
                        <span>采集交换集群与租户集群数据流转</span>
                      </Checkbox>
                      </Col>
                      <Col style="left:2%">
                      <Checkbox v-model="account[index].accountPeopleEntity.hftps[0].isPerson" :disabled="!item.ifedit">
                        <span>采集交换集群与租户个人FTP数据流转</span>
                      </Checkbox>
                      </Col>
                      <Col style="left:2%">
                      <Checkbox v-model="account[index].accountPeopleEntity.hftps[0].isPro" :disabled="!item.ifedit">
                        <span>采集交换集群与生产集群（如Hadoop三期二生产集群）数据流转</span>
                      </Checkbox>
                      </Col>
                    </Row>
                  </template>
                  </Col>
                  <Col v-if="item.ifedit || account[index].isPaas" style="padding-top: 10px">
                  <Checkbox v-model="account[index].isPaas" @on-change="changePaas(index)" :disabled="!item.ifedit">
                    <span>PaaS门户账号</span>
                  </Checkbox>
                  <template v-if="account[index].isPaas">
                    <Row style="left:2%">
                      <Col span="11">
                      <FormItem label="账号类型：" :label-width="120" :required="true">
                        <Select v-model="account[index].accountPeopleEntity.paas[0].paasType" style="width:43%" :disabled="!item.ifedit" :transfer="true">
                          <Option v-for="item in paasList" :value="item.value" :key="item.value">{{ item.label }}
                          </Option>
                        </Select>
                      </FormItem>
                      </Col>
                    </Row>
                  </template>
                  </Col>
                  <Col v-if="item.ifedit || account[index].isDacp">
                  <Checkbox v-model="account[index].isDacp" @on-change="changeDacp(index)" :disabled="!item.ifedit">
                    <span>DACP账号</span>
                  </Checkbox>
                  <template v-if="account[index].isDacp">
                    <Row style="left:2%">
                      <Col span="11">
                      <FormItem label="账号类型：" :label-width="120" :required="true">
                        <Select v-model="account[index].accountPeopleEntity.dacps[0].dacpAccoutType" style="width:43%" :disabled="!item.ifedit" :transfer="true">
                          <Option v-for="item in dacpList" :value="item.value" :key="item.value">{{ item.label }}
                          </Option>
                        </Select>
                      </FormItem>
                      </Col>
                    </Row>
                  </template>
                  </Col>
                  <Col v-if="item.ifedit || account[index].isElse">
                  <Checkbox v-model="account[index].isElse" @on-change="changeElse(index)" :disabled="!item.ifedit">
                    <span>其他权限内容</span>
                  </Checkbox>
                  <template v-if="account[index].isElse">
                    <label class="myLabel"></label>
                    <Input v-model="account[index].accountPeopleEntity.elseAuthes[0].des" size="small" style="width:40%;padding-top: 5px"
                      :readonly="!item.ifedit" type="textarea" :autosize="true" />
                  </template>
                  </Col>
               <!--  </FormItem> -->
                </Col>
              </Row>
            </Form>
          </td>
        </tr>
      </template>
    </table>
    <div v-else>
      <div class="gcontent" style="text-align:center">
        <span style="font-size: 13px;margin-left: 15px;color:#bbb; ">暂无相关账号信息</span>
      </div>
    </div>

  </div>
</template>

<script>
  import Axios from 'axios'
  import ajax from "../../../ajax_util"

  export default {
    components: {},
    data() {
      return {
        // account:[],
        // toolAccountAll: [],
        // resAccountAll: [],
        // type: 2,
        sysList: [],
        allAccountList:[],
        // resourceList: [],
        // toolList: [],
        // res_toolId: 0,
        // sysTypeList:[],
        attrList: [{
            value: "个人实名制账号",
            label: "个人实名制账号"
          },
          {
            value: "程序内置账号",
            label: "程序内置账号"
          },
          {
            value: "超级用户账号",
            label: "超级用户账号"
          },
          {
            value: "FTP账号",
            label: "FTP账号"
          },
          {
            value: "前台账号",
            label: "前台账号"
          }
        ],
        dbTypeList: [{
            value: "Mysql",
            label: "Mysql"
          },
          {
            value: "GBase",
            label: "GBase"
          },
          {
            value: "Vertica",
            label: "Vertica"
          },
          {
            value: "其他",
            label: "其他"
          }
        ],
        paasList: [{
            value: "paas_huawei",
            label: "华为PaaS"
          },
          {
            value: "paas_asia",
            label: "亚信PaaS"
          }
        ],
        dacpList: [{
            value: "平台管理",
            label: "平台管理"
          },
          {
            value: "开发管理(团队管理员)",
            label: "开发管理(团队管理员)"
          },
          {
            value: "数据开发(团队成员)",
            label: "数据开发(团队成员)"
          }
        ],
        hadoopList: [{
            value: "HDFS",
            label: "HDFS"
          },
          {
            value: "Hive",
            label: "Hive"
          },
          {
            value: "HBase",
            label: "HBase"
          },
          {
            value: "Kafka",
            label: "Kafka"
          },
          {
            value: "Flume",
            label: "Flume"
          },
          {
            value: "UDF",
            label: "UDF"
          },
          {
            value: "HFTP",
            label: "HFTP"
          },
          {
            value: "其他",
            label: "其他"
          }
        ],
        typeList: [{
            id: 1,
            typeName: "资源账号配置"
          },
          {
            id: 2,
            typeName: "工具账号配置"
          }
        ],
        // account:[],
        removeAccountIdList:[],
        ifReset:false,
        count:0,
      }
    },
    created: function() {

    },
    mounted() {
      console.log("----account--------", this.account, this.ifedit);
      if(!this.isShow){
	      if (this.isEdit) {
	        this.getSys();
	      } else {
	      	if(!this.ifedit){
	         this.getAllAccount();
	      	}
	        else if (this.ifedit) {
	          this.getDetailAccount();
	        }
	      }
      }

      if(this.isSon){
        console.log("---this.isSon------",this.isSon,this.dataInfo);
        this.getDetailAccount();
      }
    },
    methods: {
    	getDetailAccount(){
    		var result = [];
    		
        if(this.isSon){
          var account = this.dataInfo ? this.dataInfo.account : null
        }else{
    		  var account = this.$parent.applyinfo ? this.$parent.applyinfo.account : this.$parent.$parent.applyinfo.account;
        }
    		console.log("====getDetailAccount=====",this.dataInfo,this.$parent);
 			  if (account != undefined && account != null) {
          		if (account.people != undefined && account.people != null && account.people.length > 0) {
          			var people = account.people;
	          		for(var j=0; j<people.length; j++){
			            if (people[j].severs != undefined && people[j].severs != null && people[j].severs.length > 0) {
			              people[j].severs.forEach(item => {
			              	var isExist = false;
			              	var index = 0;
			              	for(var i=0; i<result.length; i++){
			              		if(result[i].id == item.serviceId){
			              			isExist = true;
			              			index = i;
			              			break;
			              		}
			              	}
			              	if(isExist){
			              		result[index].accountPeopleEntity.severs.push(item);
			              	}else{
		                		var temp = {
							        id: item.serviceId,
							        serviceId:0,
							        serviceName:item.serviceName,
							        sysIdList: [],

							        accountPeopleEntity:{
								        severs: [],
								        dbs: [],
								        hadoops: [],
								        hftps: [],
								        paas: [],
								        dacps: [],
								        elseAuthes: [],
							        },
							        modelName:item.modelName,

							        isExpand: 0,
							        // ifedit: false,
							        // isSever: true,
							        // isDb: false,
							        // isHadoop: false,
							        // isHftp: false,
							        // isPaas: false,
							        // isDacp: false,
							        // isElse: false,
						        }
						        temp.accountPeopleEntity.severs.push(item)
						        result.push(temp)
			              	}
			              })
			            }

			            if (people[j].dbs != undefined && people[j].dbs != null && people[j].dbs.length > 0) {
			              people[j].dbs.forEach(item => {
			              	var isExist = false;
			              	var index = 0;
			              	for(var i=0; i<result.length; i++){
			              		if(result[i].id == item.serviceId){
			              			isExist = true;
			              			index = i;
			              			break;
			              		}
			              	}
			              	if(isExist){
			              		result[index].accountPeopleEntity.dbs.push(item);
			              	}else{
		                		var temp = {
							        id: item.serviceId,
							        serviceId:0,
							        serviceName:item.serviceName,
							        sysIdList: [],

							        accountPeopleEntity:{
								        severs: [],
								        dbs: [],
								        hadoops: [],
								        hftps: [],
								        paas: [],
								        dacps: [],
								        elseAuthes: [],
							        },
							        modelName:item.modelName,

							        isExpand: 0,
							        // ifedit: false,
							        // isSever: false,
							        // isDb: true,
							        // isHadoop: false,
							        // isHftp: false,
							        // isPaas: false,
							        // isDacp: false,
							        // isElse: false,
						        }
						        temp.accountPeopleEntity.dbs.push(item)
						        result.push(temp)
			              	}
			              })
			            }

			         	if (people[j].hadoops != undefined && people[j].hadoops != null && people[j].hadoops.length > 0) {
			              people[j].hadoops.forEach(item => {
			              	var isExist = false;
			              	var index = 0;
			              	for(var i=0; i<result.length; i++){
			              		if(result[i].id == item.serviceId){
			              			isExist = true;
			              			index = i;
			              			break;
			              		}
			              	}
			              	if(isExist){
			              		result[index].accountPeopleEntity.hadoops.push(item);
			              	}else{
		                		var temp = {
							        id: item.serviceId,
							        serviceId:0,
							        serviceName:item.serviceName,
							        sysIdList: [],

							        accountPeopleEntity:{
								        severs: [],
								        dbs: [],
								        hadoops: [],
								        hftps: [],
								        paas: [],
								        dacps: [],
								        elseAuthes: [],
							        },
							        modelName:item.modelName,

							        isExpand: 0,
							        // ifedit: false,
							        // isSever: false,
							        // isDb: false,
							        // isHadoop: true,
							        // isHftp: false,
							        // isPaas: false,
							        // isDacp: false,
							        // isElse: false,
						        }
						        temp.accountPeopleEntity.hadoops.push(item)
						        result.push(temp)
						        console.log("-里面--",temp);
			              	}
			              })
			            }

			             if (people[j].hftps != undefined && people[j].hftps != null && people[j].hftps.length > j) {
			              people[j].hftps.forEach(item => {
			              	var isExist = false;
			              	var index = 0;
			              	for(var i=0; i<result.length; i++){
			              		if(result[i].id == item.serviceId){
			              			isExist = true;
			              			index = i;
			              			break;
			              		}
			              	}
			              	if(isExist){
			              		result[index].accountPeopleEntity.hftps.push(item);
			              	}else{
		                		var temp = {
							        id: item.serviceId,
							        serviceId:0,
							        serviceName:item.serviceName,
							        sysIdList: [],

							        accountPeopleEntity:{
								        severs: [],
								        dbs: [],
								        hadoops: [],
								        hftps: [],
								        paas: [],
								        dacps: [],
								        elseAuthes: [],
							        },
							        modelName:item.modelName,

							        isExpand: 0,
							        // ifedit: false,
							        // isSever: false,
							        // isDb: false,
							        // isHadoop: false,
							        // isHftp: true,
							        // isPaas: false,
							        // isDacp: false,
							        // isElse: false,
						        }
						        temp.accountPeopleEntity.hftps.push(item)
						        result.push(temp)
			              	}
			              })
			            }

			            if (people[j].paas != undefined && people[j].paas != null && people[j].paas.length > 0) {
			              people[j].paas.forEach(item => {
			              	var isExist = false;
			              	var index = 0;
			              	for(var i=0; i<result.length; i++){
			              		if(result[i].id == item.serviceId){
			              			isExist = true;
			              			index = i;
			              			break;
			              		}
			              	}
			              	if(isExist){
			              		result[index].accountPeopleEntity.paas.push(item);
			              	}else{
		                		var temp = {
							        id: item.serviceId,
							        serviceId:0,
							        serviceName:item.serviceName,
							        sysIdList: [],

							        accountPeopleEntity:{
								        severs: [],
								        dbs: [],
								        hadoops: [],
								        hftps: [],
								        paas: [],
								        dacps: [],
								        elseAuthes: [],
							        },
							        modelName:item.modelName,

							        isExpand: 0,
							        // ifedit: false,
							        // isSever: false,
							        // isDb: false,
							        // isHadoop: false,
							        // isHftp: false,
							        // isPaas: true,
							        // isDacp: false,
							        // isElse: false,
						        }
						        temp.accountPeopleEntity.paas.push(item)
						        result.push(temp)
			              	}
			              })
			            }

			            if (people[j].dacps != undefined && people[j].dacps != null && people[j].dacps.length > 0) {
			              people[j].dacps.forEach(item => {
			              	var isExist = false;
			              	var index = 0;
			              	for(var i=0; i<result.length; i++){
			              		if(result[i].id == item.serviceId){
			              			isExist = true;
			              			index = i;
			              			break;
			              		}
			              	}
			              	if(isExist){
			              		result[index].accountPeopleEntity.dacps.push(item);
			              	}else{
		                		var temp = {
							        id: item.serviceId,
							        serviceId:0,
							        serviceName:item.serviceName,
							        sysIdList: [],

							        accountPeopleEntity:{
								        severs: [],
								        dbs: [],
								        hadoops: [],
								        hftps: [],
								        paas: [],
								        dacps: [],
								        elseAuthes: [],
							        },
							        modelName:item.modelName,

							        isExpand: 0,
							        // ifedit: false,
							        // isSever: false,
							        // isDb: false,
							        // isHadoop: false,
							        // isHftp: false,
							        // isPaas: false,
							        // isDacp: true,
							        // isElse: false,
						        }
						        temp.accountPeopleEntity.dacps.push(item)
						        result.push(temp)
			              	}
			              })
			            }

			            if (people[j].elseAuthes != undefined && people[j].elseAuthes != null && people[j].elseAuthes.length > 0) {
			              people[j].elseAuthes.forEach(item => {
			              	var isExist = false;
			              	var index = 0;
			              	for(var i=0; i<result.length; i++){
			              		if(result[i].id == item.serviceId){
			              			isExist = true;
			              			index = i;
			              			break;
			              		}
			              	}
			              	if(isExist){
			              		result[index].accountPeopleEntity.elseAuthes.push(item);
			              	}else{
		                		var temp = {
							        id: item.serviceId,
							        serviceId:0,
							        serviceName:item.serviceName,
							        sysIdList: [],

							        accountPeopleEntity:{
								        severs: [],
								        dbs: [],
								        hadoops: [],
								        hftps: [],
								        paas: [],
								        dacps: [],
								        elseAuthes: [],
							        },
							        modelName:item.modelName,

							        isExpand: 0,
							        // ifedit: false,
							        // isSever: false,
							        // isDb: false,
							        // isHadoop: false,
							        // isHftp: false,
							        // isPaas: false,
							        // isDacp: false,
							        // isElse: true,
						        }
						        temp.accountPeopleEntity.elseAuthes.push(item)
						        result.push(temp)
			              	}
			              })
			            }
	          		}
          		}
          	}

            result.forEach(item=>{
              if(item.accountPeopleEntity.severs.length>0){
                item.isSever=true;
              }else{
                item.isSever=false;
              }

              if(item.accountPeopleEntity.dbs.length>0){
                item.isDb=true;
              }else{
                item.isDb=false;
              }

              if(item.accountPeopleEntity.hadoops.length>0){
                item.isHadoop=true;
              }else{
                item.isHadoop=false;
              }

              if(item.accountPeopleEntity.hftps.length>0){
                item.isHftp=true;
              }else{
                item.isHftp=false;
              }

              if(item.accountPeopleEntity.paas.length>0){
                item.isPaas=true;
              }else{
                item.isPaas=false;
              }

               if(item.accountPeopleEntity.dacps.length>0){
                item.isDacp=true;
              }else{
                item.isDacp=false;
              }

              if(item.accountPeopleEntity.elseAuthes.length>0){
                item.isElse=true;
              }else{
                item.isElse=false;
              }
            })

            if(this.isSon){
              result = this.getSonAccount(result, this.dataInfo);
            }

            this.account = result;

            console.log("getDetailAccount",this.account,result)
            if(this.reqId != null && this.reqId != "" && !this.ifedit){
                this.$parent.$parent.getPeopleAccount();
            }
    	},
      getSonAccount(result, dataInfo){
        console.log("----getSonAccount------",result,dataInfo);
        var account = [];
        var idList = [];
        if(result.length>0){
          if(dataInfo != null){
            if(dataInfo.resourceList != null){
              dataInfo.resourceList.forEach(item=>{
                idList.push(item.templateAccountId)
              })
            }

            if(dataInfo.toolList != null){
              dataInfo.toolList.forEach(item=>{
                idList.push(item.templateAccountId)

                if(item.resourceProgress != null && item.resourceProgress.length>0){
                  item.resourceProgress.forEach(key=>{
                    idList.push(key.templateAccountId)
                  })
                }
              })
            }
          }

          result.forEach(item=>{
            if(idList.indexOf(item.id) > -1){
              account.push(item)
            }
          })
        }
        console.log("--wwww--getSonAccount------",account,idList);
        return account;
      },
   		getAllAccount(){
	        var that = this;
	        var url = this.CONFIG.progress_url + "/template-acconut/all";
	        ajax.get({
	          that: that,
	          url: url,
	          success: function(data) {
	            console.log("---getAllAccount-------", data);
	            that.allAccountList = data;

              if(that.reqId != null && that.reqId != ""){
	   			     that.getDetailAccount();

              }
	          }
	        })
   		},
   		setAccount(entrySysId,accountList){
        this.count = this.count + 1;
   			console.log("----setAccount---",entrySysId,accountList);
   			// this.account = [];
   			var tempAccount = [];
   			var existIdList = [];
   			this.allAccountList.forEach(item=>{
   				if(item.sysIdList.indexOf(entrySysId) > -1){
   					console.log("pp",item);
   					accountList.forEach(value=>{
   						if(value.id == item.id){
   							if(existIdList.indexOf(value.id) < 0){
	   							item.serviceId = value.serviceId;
	   							item.serviceName = value.serviceName;
                  item.isTool = value.isTool;
                  item.isRes = value.isRes;
	   							tempAccount.push(item);
	   							existIdList.push(value.id);
   							}else{
   								tempAccount.forEach(val=>{
   									if(val.id == value.id && val.serviceId != value.serviceId){
   										val.serviceName = val.serviceName + "/" + value.serviceName
                      if( (val.isTool && value.isRes) || (val.isRes && value.isTool) ){
                        val.isTool = true;
                        val.isRes = true;
                      }
   									}
   								})
   							}
   						}
   					})
   				}
   			})

        var existList = this.$parent.$parent.account;
        if(this.$parent.$parent.applyinfo.account.people != null && this.$parent.$parent.applyinfo.account.people.length>0){
     			if(!this.ifReset && this.reqId != null && this.reqId != "" && this.count<2){
  	   			tempAccount.forEach(item=>{
  	   				var bol = false;
  	   				existList.forEach(value=>{
  	   					if(item.id == value.id){
  	   						bol = true;
  	   					}
  	   				})

  	   				if(!bol){
  	   					this.removeAccountIdList.push(item.id);
  	   				}
  	   			})
     			}
        }

   			var compareAccount = [];
   			tempAccount.forEach(item=>{
   				if(this.removeAccountIdList.indexOf(item.id) < 0){
   					compareAccount.push(item);
   				}
   			})
   			// this.$forceUpdate();
   			this.account = compareAccount;
   			this.ifReset = false;
   			console.log("result11",this.account,this.removeAccountIdList);
   			console.log("result22",tempAccount,compareAccount);
        // this.$parent.setOverviewAccount(this.account);
   		},
   		removeAccount(index){
	        this.$Modal.confirm({
	          title: '确定删除该账号？',
	          width: '360',
	          onOk: () => {
	          	this.removeAccountIdList.push(this.account[index].id);
	          	this.account.splice(index,1)
	          }
	        });
   		},
   		resetAccount(){
        if(this.$parent.$parent.applyinfo.account.people != null && this.$parent.$parent.applyinfo.account.people.length>0){
     			this.removeAccountIdList = [];
     			this.account = [];
     			this.ifReset = true;
     			console.log("--this.$parent-----",this.$parent);
     			this.$parent.$parent.getPeopleAccount();
        }
   		},

      showCount(item) {
        var str = "";
        if (item.isSever) {
          str = str + "主机账号" + item.accountPeopleEntity.severs.length + "个;"
        }

        if (item.isDb) {
          str = str + "数据库账号" + item.accountPeopleEntity.dbs.length + "个;"
        }

        if (item.isHadoop) {
          str = str + "Hadoop账号" + item.accountPeopleEntity.hadoops.length + "个;"
        }

        if (item.isHftp) {
          str = str + "UAP账号" + item.accountPeopleEntity.hftps.length + "个;"
        }

        if (item.isPaas) {
          str = str + "paas账号" + item.accountPeopleEntity.paas.length + "个;"
        }

        if (item.isDacp) {
          str = str + "dacps账号" + item.accountPeopleEntity.dacps.length + "个;"
        }

        if (item.isElse) {
          str = str + "其他权限账号" + item.accountPeopleEntity.elseAuthes.length + "个；"
        }

        return str;
      },
      getSys() {
        var that = this;
        var url = this.CONFIG.progress_url + "/system-map/for/paas";
        ajax.get({
          that: that,
          url: url,
          success: function(data) {
            that.sysList = data;
            // that.getPageAccount();
            console.log("---sysList-------", data);
          }
        })
      },
      getPageAccount(){
      	var params = this.$parent.params;
        var that = this;
        var url = this.CONFIG.progress_url + "/template-acconut/page";
        console.log("---ssss-------", params);
        ajax.post({
          that: that,
          url: url,
          data:params,
          success: function(data) {
            console.log("---getPageAccount-------", data);
            that.account = data.records;
            that.$parent.setParams(data.total);
          }
        })
      },
      showSysName(sysModel) {
        var str = "";
        if (sysModel != undefined && sysModel != null) {
          for (var i = 0; i < sysModel.length; i++) {
            if (sysModel[i].id > 0) {
              str = str + sysModel[i].sysName + "、"
            }
          }

          str = str.slice(0, str.length - 1);
        }
        return str;
      },
      addRow() {
      	console.log("-----addRow----",this.account);
        this.account.push({
          id: 0,
          sysIdList: [],

          accountPeopleEntity:{
	          severs: [],
	          dbs: [],
	          hadoops: [],
	          hftps: [],
	          paas: [],
	          dacps: [],
	          elseAuthes: [],
          },
          modelName:"",

          isExpand: 0,
          ifedit: true,
          isSever: false,
          isDb: false,
          isHadoop: false,
          isHftp: false,
          isPaas: false,
          isDacp: false,
          isElse: false,
        })
      },
      editRow(index) {
        if (this.account[index].ifedit) {
          // this.account[index].ifedit = false;
          this.getPageAccount();
        } else {
          console.log("_----editRow-----");
          this.account[index].ifedit = true;
          this.account[index].isExpand = 0;
          this.$forceUpdate();
        }
      },
      saveRow(index){
      	console.log("-----saveRow---",this.account[index]);
      	if(this.validate(this.account[index])){
	      	if(this.account[index].id > 0){
		      	var params = this.account[index];
		        var that = this;
		        var url = this.CONFIG.progress_url + "/template-acconut/update";
		        ajax.post({
		          that: that,
		          url: url,
		          data:params,
		          success: function(data) {
		          	// that.account[index].ifedit = false;
		          	if(data == 0){
			            that.$Notice.success({
			                title: '修改模板成功!'
			            })
			            that.getPageAccount();
		          	}else if(data == -1){
		          		that.$Message.error({
			              content: '账号模板名称重复!',
			              duration: 3
			            });
		          	}else{
		          		that.$Message.error({
			              content: '系统错误!',
			              duration: 3
			            });
		          	}
		          }
		        })
	      	}else{
		      	var params = this.account[index];
		        var that = this;
		        var url = this.CONFIG.progress_url + "/template-acconut/add";
		        ajax.post({
		          that: that,
		          url: url,
		          data:params,
		          success: function(data) {
		          	// that.account[index].ifedit = false;
		          	if(data == 0){
			            that.$Notice.success({
			                title: '新增模板成功!'
			            })
			            that.getPageAccount();
		          	}else if(data == -1){
		          		that.$Message.error({
			              content: '账号模板名称重复!',
			              duration: 3
			            });
		          	}else{
		          		that.$Message.error({
			              content: '系统错误!',
			              duration: 3
			            });
		          	}
		          }
		        })
	      	}
      	}

      },
      removeRow(index) {
        this.$Modal.confirm({
          title: '确定删除该配置？',
          width: '360',
          onOk: () => {
          	var id = this.account[index].id;
	        var that = this;
	        var url = this.CONFIG.progress_url + "/template-acconut/del/" + id;
	        ajax.del({
	          that: that,
	          url: url,
	          success: function(data) {
	            that.$Notice.success({
	                title: '删除模板成功!'
	            })

	            if(that.account.length == 1 && that.$parent.params.current != 1){
	            	that.$parent.setLastPage();
	            }
	            that.getPageAccount();
	          }
	        })
          }
        });
      },
      expandRow(index) {
        console.log("----",this.account[index].isExpand);
        if (this.account[index].isExpand < 0) {
          this.account[index].isExpand = 0;
          console.log("--0000--",this.account[index].isExpand);
        } else {
          this.account[index].isExpand = -1;
          console.log("---1-1-1-1--",this.account[index].isExpand);
        }
        // this.$forceUpdate();
      },
      changeSever(index) {
        this.account[index].accountPeopleEntity.severs = [];
        if (this.account[index].isSever) {
          this.account[index].accountPeopleEntity.severs.push({
            accountAttr: "",
            id: 0,
            ip: "",
            rxPath: "",
            sname: "",
            wpath: ""
          });
        }
      },
      addServer(index) {
        this.account[index].accountPeopleEntity.severs.push({
          accountAttr: "",
          id: 0,
          ip: "",
          rxPath: "",
          sname: "",
          wpath: "",
          serviceId: 0
        });
      },
      removeServer(index, ser_index) {
        this.account[index].accountPeopleEntity.severs.splice(ser_index, 1);
      },
      changeDb(index) {
        this.account[index].accountPeopleEntity.dbs = [];
        if (this.account[index].isDb) {
          this.account[index].accountPeopleEntity.dbs.push({
            accountAttr: "",
            auth: "",
            dbName: "",
            dbType: "",
            id: 0,
            ip: "",
            sname: "",
            tableName: "",
            schema: ""
          });
        }
      },
      addDB(index) {
        this.account[index].accountPeopleEntity.dbs.push({
          accountAttr: "",
          auth: "",
          dbName: "",
          dbType: "",
          id: 0,
          ip: "",
          sname: "",
          tableName: "",
          serviceId: 0,
          schema: ""
        });
      },
      removeDB(index, db_index) {
        this.account[index].accountPeopleEntity.dbs.splice(db_index, 1);
      },
      changeHadoop(index) {
        this.account[index].accountPeopleEntity.hadoops = [];
        if (this.account[index].isHadoop) {
          this.account[index].accountPeopleEntity.hadoops.push({
            hadoopAccountType: "",
            auth: "",
            keytab: "",
            id: 0
          });
        }
      },
      addHadoop(index) {
        this.account[index].accountPeopleEntity.hadoops.push({
          hadoopAccountType: "",
          auth: "",
          keytab: "",
          id: 0,
          serviceId: 0
        });
      },
      removeHadoop(index, ha_index) {
        this.account[index].accountPeopleEntity.hadoops.splice(ha_index, 1);
      },
      changeUap(index) {
        this.account[index].accountPeopleEntity.hftps = [];
        if (this.account[index].isHftp) {
          this.account[index].accountPeopleEntity.hftps.push({
            id: 0,
            isCluster: false,
            isPerson: false,
            isPro: false,
            serviceId: 0
          });
        }
      },
      changePaas(index) {
        this.account[index].accountPeopleEntity.paas = [];
        if (this.account[index].isPaas) {
          this.account[index].accountPeopleEntity.paas.push({
            id: 0,
            paasType: "",
            serviceId: 0
          });
        }
        console.log(this.account[index].paas);
      },
      changeDacp(index) {
        this.account[index].accountPeopleEntity.dacps = [];
        if (this.account[index].isDacp) {
          this.account[index].accountPeopleEntity.dacps.push({
            dacpAccoutType: "",
            id: 0,
            serviceId: 0
          });
        }
      },
      changeElse(index) {
        console.log("1", this.account[index]);
        this.account[index].accountPeopleEntity.elseAuthes = [];
        if (this.account[index].isElse) {
          this.account[index].accountPeopleEntity.elseAuthes.push({
            des: "",
            id: 0,
            serviceId: 0
          });
        }
        console.log("2", this.account[index].elseAuthes);
      },
      checkIP(data) {
        let ipRegex =
          /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
        if (ipRegex.test(data) === false) {
          return false;
        } else {
          return true;
        }
      },
      validate(data) {
        console.log("-----hhhhhh-------", data);
        var vaild = true;

	    if (data.modelName == undefined || data.modelName == null || data.modelName == "") {
	        this.$Message.error({
	          content: '请填写账号模板名称!',
	          duration: 3
	        });
	        vaild = false;
	        return vaild;
	    }

        if (data.sysIdList == undefined || data.sysIdList == null || data.sysIdList
            .length < 1) {
            this.$Message.error({
              content: '请选择入驻位置!',
              duration: 3
            });
            vaild = false;
            return vaild;
        }

        if (!(data.isSever || data.isDb || data.isHadoop || data.isHftp ||
              data.isPaas || data.isDacp || data.isElse)) {
            this.$Message.error({
              content: '请至少配置一种账号类型!',
              duration: 3
            });
            vaild = false;
            return vaild;
         }

        if (data.isSever) {
            if (data.accountPeopleEntity.severs.length === 0) {
              this.$Message.error({
                content: '请至少新增一个主机账号!',
                duration: 3
              });
              vaild = false;
              return vaild;
            } else {
              for (var j = 0; j < data.accountPeopleEntity.severs.length; j++) {
                var number2 = j + 1
                if (this.utils.objectIsEmpty(data.accountPeopleEntity.severs[j].accountAttr)) {
                  this.$Message.error({
                    content: '请填写第' + number2 + '条主机账号的账号属性!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }
                if (this.utils.objectIsEmpty(data.accountPeopleEntity.severs[j].ip)) {
                  this.$Message.error({
                    content: '请填写第' + number2 + '条主机账号的设备IP地址!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }
                if (!this.checkIP(data.accountPeopleEntity.severs[j].ip)) {
                  this.$Message.error({
                    content: '第' + number2 + '条主机账号的设备IP地址格式不正确!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }
              }
            }
        }

        if (data.isDb) {
            if (data.accountPeopleEntity.dbs.length === 0) {
              this.$Message.error({
                content: '请至少新增一个数据库账号!',
                duration: 3
              });
              vaild = false;
              return vaild;
            } else {
              for (var j = 0; j < data.accountPeopleEntity.dbs.length; j++) {
                var number2 = j + 1
                if (this.utils.objectIsEmpty(data.accountPeopleEntity.dbs[j].dbType)) {
                  this.$Message.error({
                    content: '请填写第' + number2 + '条数据库账号的数据库类型!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }
                if (this.utils.objectIsEmpty(data.accountPeopleEntity.dbs[j].accountAttr)) {
                  this.$Message.error({
                    content: '请填写第' + number2 + '条数据库账号的账号属性!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }
                if (this.utils.objectIsEmpty(data.accountPeopleEntity.dbs[j].ip)) {
                  this.$Message.error({
                    content: '请填写第' + number2 + '条数据库账号的设备IP地址!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }

                if (!this.checkIP(data.accountPeopleEntity.dbs[j].ip)) {
                  this.$Message.error({
                    content: '第' + number2 + '条数据库账号的设备IP地址格式不正确!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }
                if (this.utils.objectIsEmpty(data.accountPeopleEntity.dbs[j].sname) && (data.accountPeopleEntity.dbs[j].dbType ===
                    "GBase" || data.accountPeopleEntity.dbs[j].dbType === "Vertica")) {
                  this.$Message.error({
                    content: '请填写第' + number2 + '条数据库账号的资源池/设备名称!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }
                if (this.utils.objectIsEmpty(data.accountPeopleEntity.dbs[j].schema) && (data.accountPeopleEntity.dbs[j].dbType ===
                    "GBase" || data.accountPeopleEntity.dbs[j].dbType === "Vertica")) {
                  this.$Message.error({
                    content: '请填写第' + number2 + '条数据库账号的schema/集群名!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }
                if (this.utils.objectIsEmpty(data.accountPeopleEntity.dbs[j].auth)) {
                  this.$Message.error({
                    content: '请填写第' + number2 + '条数据库账号的权限!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }
              }
            }
        }

        if (data.isHadoop) {
            if (data.accountPeopleEntity.hadoops.length === 0) {
              this.$Message.error({
                content: '请至少新增一个Hadoop账号!',
                duration: 3
              });
              vaild = false;
              return vaild;
            } else {
              for (var j = 0; j < data.accountPeopleEntity.hadoops.length; j++) {
                var number2 = j + 1
                if (this.utils.objectIsEmpty(data.accountPeopleEntity.hadoops[j].keytab)) {
                  this.$Message.error({
                    content: '请填写第' + number2 + '条Hadoop账号的keytab描述!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }
                if (this.utils.objectIsEmpty(data.accountPeopleEntity.hadoops[j].hadoopAccountType)) {
                  this.$Message.error({
                    content: '请填写第' + number2 + '条Hadoop账号的Hadoop组件!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }
                if (this.utils.objectIsEmpty(data.accountPeopleEntity.hadoops[j].auth)) {
                  this.$Message.error({
                    content: '请填写第' + number2 + '条Hadoop账号的具体权限描述!',
                    duration: 3
                  });
                  vaild = false;
                  return vaild;
                }
              }
            }
        }

        if (data.isHftp) {
            for (var j = 0; j < data.accountPeopleEntity.hftps.length; j++) {
              if (!(data.accountPeopleEntity.hftps[j].isCluster || data.accountPeopleEntity.hftps[j].isPerson || data.accountPeopleEntity.hftps[j].isPro)) {
                this.$Message.error({
                  content: '请选择UAP账号的场景说明!',
                  duration: 3
                });
                vaild = false;
                return vaild;
              }
            }
          }

        if (data.isPaas) {
            for (var j = 0; j < data.accountPeopleEntity.paas.length; j++) {
              if (this.utils.objectIsEmpty(data.accountPeopleEntity.paas[j].paasType)) {
                this.$Message.error({
                  content: '请选择PaaS门户账号类型!',
                  duration: 3
                });
                vaild = false;
                return vaild;
              }
            }
          }

        if (data.isDacp) {
            for (var j = 0; j < data.accountPeopleEntity.dacps.length; j++) {
              if (this.utils.objectIsEmpty(data.accountPeopleEntity.dacps[j].dacpAccoutType)) {
                this.$Message.error({
                  content: '请选择DACP账号类型!',
                  duration: 3
                });
                vaild = false;
                return vaild;
              }
            }
        }

        if (data.isElse) {
            for (var j = 0; j < data.accountPeopleEntity.elseAuthes.length; j++) {
              if (this.utils.objectIsEmpty(data.accountPeopleEntity.elseAuthes[j].des)) {
                this.$Message.error({
                  content: '请填写其他权限内容的描述!',
                  duration: 3
                });
                vaild = false;
                return vaild;
              }
            }
        }

        return vaild;
      },
    },
    computed: {
      account: {
        get: function() {
          console.log("22222222", this.value);
          return this.value;
        },
        set: function(value) {
          console.log("33333333", value);
          this.$emit('input', value);
        }
      },
    },
    props: {
      // applyInfo:{},
      value: {},
      // checkType: {},
      isEdit: {},
      isShow: {},
      ifedit: {},
      reqId: {},
      isSon: {},
      isPrint: {
        type: Boolean,
        default: false
      },
      // printInfo:{},
      dataInfo: {
        default: null
      },
      // peopleList:{}
    },
    watch: {
      dataInfo(value) {
        console.log("-------dataInfo------", value);
        this.dataInfo = value;
      },
      isEdit(value) {
        console.log("-------applyInfo------", value);
        this.isEdit = value;
      },
      isShow(value) {
        console.log("-------applyInfo------", value);
        this.isShow = value;
      },
      ifedit(value) {
        console.log("-------ifedit------", value);
        this.ifedit = value;
      },
      isPrint(value) {
        console.log("-------applyInfo------", value);
        this.isPrint = value;
      }
    }
  }
</script>
